//
//  UIImage+Image.m
//  weibo
//
//  Created by 胡金东 on 16/2/10.
//  Copyright © 2016年 胡金东. All rights reserved.
//
//用category（类别）抽出的相同的内容，写一个类名就可以调用了
#import "UIImage+Image.h"

@implementation UIImage (Image)
//类方法定义图片大小为原始的尺寸
+(instancetype)imageWithOriginalName:(NSString *)imageName
{
    UIImage *image = [UIImage imageNamed:imageName];
   return  [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
}

+ (instancetype)imageWithStretchableName:(NSString *)imageName
{
    UIImage *image = [UIImage imageNamed:imageName];
    return [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
}



@end
